class Page < ActiveRecord::Base
  set_table_name "Page"
  set_primary_key "primaryKey"
  has_many :images
  has_many :bigimages
  has_many :textimages
  
  def getUrl
    "/" + categoryNameUrl + "/"+ pageNameUrl + ".html"
  end
  
  def self.cleanUrl(inUrl)
    outUrl = inUrl.downcase
    outUrl = outUrl.tr(" ", "-")
    outUrl = outUrl.tr(".", "-")
    outUrl = outUrl.tr(";", "-")
    outUrl = outUrl.tr(",", "-")
    outUrl = outUrl.tr("!", "-")
    return outUrl
  end
 
end
